feat: add transpileJsxSource api for raw jsx input. - #83
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a new public API to transpile raw JSX/TSX source strings into React.createElement(...) calls, intended for editor-like scenarios where you need JSX support without Babel.
Changes:
- Introduces
transpileJsxSource()implementation built onoxc-parser,magic-string, and a JSX-to-createElementbuilder. - Exposes the new API and types from the package root entry.
- Adds README documentation and a Vitest test suite for the new transpiler.
Reviewed changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
src/transpile.ts |
Implements the new raw-source JSX transpilation API. |
src/index.ts |
Re-exports the new API/types from the public entrypoint. |
test/transpile.test.ts |
Adds initial unit tests for transpileJsxSource(). |
README.md |
Documents the new source transpilation API and options. |
package.json |
Bumps version to 1.8.0. |
package-lock.json |
Updates lockfile version fields to 1.8.0. |
.gitattributes |
Sets text normalization and LF endings. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #83 +/- ##
==========================================
- Coverage 88.81% 88.12% -0.69%
==========================================
Files 23 24 +1
Lines 1707 1861 +154
Branches 460 502 +42
==========================================
+ Hits 1516 1640 +124
- Misses 54 70 +16
- Partials 137 151 +14 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR introduces a new transpileJsxSource API intended to transform raw JSX source strings into React.createElement(...) calls (and fragments), without relying on Babel, and wires it into the package via a new subpath export.
Changes:
- Add
src/transpile.tsimplementingtranspileJsxSource()usingoxc-parser+magic-string. - Add comprehensive unit tests for source transpilation behavior.
- Publish/document the new API via
package.jsonexport (./transpile) and README updates (plus version bump).
Reviewed changes
Copilot reviewed 10 out of 11 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
src/transpile.ts |
Implements the new raw-source JSX transpilation API. |
test/transpile.test.ts |
Adds unit coverage for the new transpilation behavior and options. |
package.json |
Bumps version and adds ./transpile subpath export. |
package-lock.json |
Lockfile version bump alignment. |
README.md |
Documents transpileJsxSource usage and customization options. |
docs/how-it-compares.md |
Updates size figures to reflect latest build outputs. |
examples/esm-demo.html |
Updates displayed bundle size numbers in the demo page. |
test/fixtures/e2e.html |
Updates displayed bundle size numbers for e2e fixture. |
playwright.config.ts |
Switches default Playwright project to chromium. |
.github/workflows/playwright.yml |
Installs chromium instead of chrome in CI. |
.gitattributes |
Enforces LF line endings via git attributes. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
No description provided.